<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    .flex-container {
      height: 100px;
      background-color: skyblue;
      /* 弹性布局 */
      display: flex;
    }
    .flex-item {
      width: 50px;
      line-height: 50px;
      font-size: 30px;
      color: #fff;
      text-align: center;
      background-color: tomato;
      padding: 5px 10px;
      margin: 5px;
    }
    .flex-item:nth-child(1) {
      /* 排列顺序，数值越小，越排前 */
      order: 1;
    }
    .flex-item:nth-child(2) {
      /* 排列顺序，数值越小，越排前 */
      order: 3;
    }
  </style>
<body>
    <!-- 
        TIP
            order属性定义项目的排列顺序。
            order属性值为>0的整数，数值越小，排列越靠前，默认为 0。
    -->

    <div class="flex-container">
        <div class="flex-item">1</div>
        <div class="flex-item">2</div>
        <div class="flex-item">3</div>
        <div class="flex-item">4</div>
      </div>
</body>
</html>